// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
		audio: {
			default: null,
			type: cc.AudioClip
		}
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
		this.AudioSource = this.node.getComponent(cc.AudioSource);
		this.node.on(cc.Node.EventType.MOUSE_ENTER,this.hover_play,this );
	},

    start () {

    },
	
	hover_play:function(){
		cc.audioEngine.play(this.audio, false);
		//this.AudioSource.play();
	},
	update (dt){
		
	},
	
	onDestroy () {
	    
	   
	},
	
    
});
